/*
 * Copyright (c) 2016. For Intelligent Group.
 */

package com.intelligent.ispc.core.entity;

import com.intelligent.ispc.common.persistence.BaseEntity;

import javax.persistence.*;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import java.util.List;

/**
 * Created by Peter on 2016/8/22.
 */
@Entity
@Table(name = "t_tolerancescheme")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ToleranceScheme extends BaseEntity {

    private String name;
    private Double usl;
    private Double lsl;
    private Integer calculateTimes;

    @OneToMany(mappedBy = "toleranceScheme")
    private List<ToleranceItem> items;

    @ManyToOne
    @JoinColumn(name = "project_id")
    private Project project;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getUsl() {
        return usl;
    }

    public void setUsl(Double usl) {
        this.usl = usl;
    }

    public Double getLsl() {
        return lsl;
    }

    public void setLsl(Double lsl) {
        this.lsl = lsl;
    }

    public Integer getCalculateTimes() { return calculateTimes; }

    public void setCalculateTimes(Integer calculateTimes) { this.calculateTimes = calculateTimes; }

    public List<ToleranceItem> getItems() {
        return items;
    }

    public void setItems(List<ToleranceItem> items) {
        this.items = items;
    }

    public Project getProject() {
        return project;
    }

    public void setProject(Project project) {
        this.project = project;
    }

}
